package com.lhys.mapper;

import com.lhys.pojo.AssetCategory;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * 资产_类别表 Mapper 接口
 * </p>
 *
 * @author 小七
 * @since 2021-05-06
 */
public interface AssetCategoryMapper {
    @Insert("INSERT INTO `asset_category` (`asset_user_id`, `title`, `code`, `status`, `remark` , `create_time`) VALUES (#{assetUserId}, #{title}, #{code}, #{status}, #{remark} , #{createTime})")
    Integer addAssetCategory(AssetCategory assetCategory);

    @Delete("DELETE FROM `asset_category` WHERE (`id`=#{id})")
    Integer delAssetCategory(Integer id);

    Integer updateAssetCategory(AssetCategory assetCategory);

    @Select("select * from `asset_category` where id = #{id}")
    AssetCategory getAssetCategoryById(Integer id);

    @Select("select * from asset_category where asset_user_id = #{assetUserId}")
    AssetCategory getAssetCategoryByUserId(Integer id);

    @Select("select * from asset_category where code = #{code}")
    AssetCategory getAssetCategoryByCode(String code);

    List<AssetCategory> getAssetCategoryByCodeAndTitleOrRemarkList(AssetCategory assetDepart);
}